﻿<%@ Page Language="C#"  %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Collections" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Data.SqlClient" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml" lang="heb"  dir="rtl">
<head id="Head1" runat="server">
       

   
   
    <!-- Plugin stylesheets -->
  
    <link href="plugins/forms/uniform/uniform.default.css" type="text/css" rel="stylesheet" />        
    <link href="plugins/tables/dataTables/jquery.dataTables.css" type="text/css" rel="stylesheet" />
    
    <!-- Main stylesheets -->
   
<style>

    .btn_edit
    {
        text-decoration:none;
        padding:2px 10px;
        color:#202020;
        border:1px solid #ccc;
        background-image:url("img/edit.png");
        background-repeat:no-repeat;
        background-position:center center;
    }
     .btn_view
    {
        text-decoration:none;
        padding:2px 10px;
        color:#202020;
        border:1px solid #ccc;
        background-image:url("img/edit.png");
        background-repeat:no-repeat;
        background-position:center center;
    }
   .frm_row
   {
       width:95%;
       float:left;
       
   }
   .frm_row label
   {
       float:left;
       width:40%;
       margin-right:20px;
   }
   .frm_row input[type="text"],select
   {
       float:left;
       width:50%;
   }
</style>

        <title></title>
 <style>
    #content 
    {
        	min-height:550px;
	background-color: #FFFFFF;
	background-image: url(../images/bg/contentbg.png);
	min-width: 82%;
	margin-right:221px;
	height:100%;
	border-left-width: 1px;
	border-left-style: solid;
	border-left-color: #CCC;
    }
    #leftcolumn {
	float: right;
	width: 220px;
	margin-left: -100%;
	min-height:550px;
	background-color: #FFF;
	background-image: url(../images/bg/sidebarbg.png);
	
	border-left-width: 1px;
	border-left-style: solid;
	border-left-color: #CCC;
	height:100%;
	
}
    </style>
</head>
<body>
 <input id="Button1" type="button" value="Print"/>
    <% string keyword = null;
       keyword = Request["param"];
         %>

       <% string keyword1 = Request["param1"]; %>
     <% string keyword2 = Request["param2"]; %>
     <% string keyword3 = Request["param3"]; %>
       <% string keyword4 = Request["param4"]; %>
         <% string keyword5 = Request["param5"]; %>
          <% string keyword6 = Request["param7"]; %>
              <% string keyword7 = Request["param8"]; %>
                 <% string keyword8 = Request["param9"]; %>
                    <% string keyword9 = Request["param10"]; %>
                       <% string keyword10 = Request["param11"]; %>
                          <% string keyword11 = Request["param12"]; %>
                            <% string keyword12 = Request["param13"]; %>
                          <% string keyword13 = Request["param14"]; %>
                             <% string keyword14 = Request["param15"]; %>
                                <% string keyword15 = Request["param17"]; %>
       <% string keyword17 = Request["param19"]; %>
    
    <%  SqlConnection con = null;
        con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnStr"].ConnectionString);
        con.Open();

        SqlCommand hmd = new SqlCommand("SELECT * FROM properties_rent where cust_proptype='" + keyword + "' or prop_cond='" + keyword1 + "' or p_ac='" + keyword2 + "' or  parking='" + keyword3 + "'or room between '" + keyword10 + "' and '" + keyword11 + "'or floor_no between '" + keyword12 + "' and '" + keyword13 + "'or price between '" + keyword6 + "' and '" + keyword7 + "' or elevator='" + keyword4 + "'  or phone='" + keyword8 + "'  or agent_name='" + keyword4 + "' or adding_date='" + keyword15 + "' or fname='" + keyword17 + "' or c_type ='" + keyword9 + "'  or agent_name ='" + keyword14 + "'", con);
       
        SqlDataReader hr = hmd.ExecuteReader();

        Response.Write("<div class=\"content noPad clearfix\">");
        Response.Write(" <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"responsive dynamicTable display table table-bordered\" id=\"example\" >");
        Response.Write(" <thead>  <tr><th >Property ID</th> <th>Agent</th><th >Propety Type</th><th>Client type</th> <th>Full Name</th><th>Phone</th><th>City</th>  <th>House No.</th><th>Apt no.</th><th>Total Floor</th><th>Floor no</th> <th>Property size</th><th>Elevator</th> <th>Parking</th><th>Price</th><th>Comments</th> <th>View</th> <th>Edit</th>  <th>Delete</th> <th>Give to rent</th></tr></thead>");

                                                    
                                            
                                       
        Response.Write("<tbody>");
    
      while (hr.Read())
      {
          string comment;
          comment = hr[118].ToString();

          comment = comment.Substring(0, 2);
          
          //  Response.Write("<td class=\"center tr_select \"><input name=\"checkbox\" type=\"checkbox\" value=\"\"></td><td>" + hr[1].ToString() + "</td><td>" + hr[2].ToString() + "</td><td>" + hr[3].ToString() + "</td><td>" + hr[4].ToString() + "</td><td><a href=\"#\" class=\"btn_attch\" title=\"View Attachment\"></a></td><td><a href=\"#\" class=\"btn_view\" title=\"View\"></a><a href=\"#\" class=\"btn_reply\" title=\"Reply\"></a><a href=\"#\" class=\"btn_del\" title=\"Delete\"></a></td></tr>");

          Response.Write("<tr> <td>" + hr[6].ToString() + "</td> <td>" + hr[4].ToString() + "</td><td>" + hr[17].ToString() + "</td><td>" + hr[2].ToString() + " </td><td>" + hr[7].ToString() + "  " + hr[8].ToString() + "</td> <td>" + hr[10].ToString() + "</td> <td>" + hr[14].ToString() + "</td><td>" + hr[12].ToString() + "  " + hr[11].ToString() + "</td><td>" + hr[27].ToString() + "</td> <td>" + hr[30].ToString() + "</td><td>" + hr[29].ToString() + "</td> <td>" + hr[89].ToString() + "" + hr[90].ToString() + "</td><td>" + hr[86].ToString() + "</td><td>" + hr[37].ToString() + "</td> <td>" + hr[100].ToString() + "" + hr[101].ToString() + "</td> <td>" + comment + "</td><td><a href=\"#\" class=\"btn_view\" title=\"View\"></a></td><td><a href=\"#\" class=\"btn_edit\" title=\"Edit\"></td><td></a><a href=\"#\" class=\"btn_del\" title=\"Reply\"></a></td><td><a href=\"#\" class=\"btn_reply\" title=\"Delete\"></a></td></td></tr>");

         
          //    Response.Write(regid);
      }
     
      Response.Write("</tbody>");
      Response.Write(" </table>");
      Response.Write(" </div>");
     hr.Close();
      con.Close(); %>


 <!--your content end-->
    
    </div> <!--toPopup end-->
  
</body>
</html>


<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>

<script type="text/javascript" src="js/popup.js"></script>
   
		<script type="text/javascript" language="javascript" src="js/datatable/jquery.dataTables.js"></script>
		  <script type="text/javascript" charset="utf-8">
		      $(document).ready(function () {
		          oTable = $('#dtable').dataTable({
		              "bJQueryUI": true,
		              "sPaginationType": "full_numbers"
		          });
		      });


		</script>
        <script type="text/javascript" charset="utf-8">
            $(document).ready(function () {
                $('#Button1').click(function () {
                    var $td = $(this).closest('tr').children('td'),
            $name = $td.eq(0).text();

                    // Save it!
                    //    document.location = 'to-rentupdate.aspx?id=' + $name;



                });
            });
</script>

    
       <%-- <script>
            $(document).ready(function () {
                $('#dtable').dataTable({
                    "sDom": 'T<"clear">lfrtip<"clear spacer">T'
                });
            });</script>--%>
    <%--    <script type="text/javascript" charset="utf-8">
            $(document).ready(function () {
                oTable = $('#dtable').dataTable({
                    "bJQueryUI": true,
                    "sPaginationType": "full_numbers"
                });
            });


		</script>--%>
    
        <%--<script>
            $(document).ready(function () {
                $('#dtable').dataTable({
                    "sDom": 'T<"clear">lfrtip<"clear spacer">T'
                });
            });</script>--%>
  <style>
                                  .btn_reply
    {
        text-decoration:none;
        padding:2px 10px;
        color:#202020;
        border:1px solid #ccc;
        background-image:url("img/reply.ico");
        background-repeat:no-repeat;
        background-position:center center;
    }
     .btn_attch
    {
        text-decoration:none;
        padding:2px 10px;
        color:#202020;
        border:1px solid #ccc;
        background-image:url("img/1393645982_103307.ico");
        background-repeat:no-repeat;
        background-position:center center;
    }
      .btn_del
    {
        text-decoration:none;
        padding:2px 10px;
        color:#202020;
        border:1px solid #ccc;
        background-image:url("img/del.ico");
        background-repeat:no-repeat;
        background-position:center center;
    }
    .btn_edit
    {
        text-decoration:none;
        padding:2px 10px;
        color:#202020;
        border:1px solid #ccc;
        background-image:url("img/edit.ico");
        background-repeat:no-repeat;
        background-position:center center;
    }
      .btn_view
    {
        text-decoration:none;
        padding:2px 10px;
        color:#202020;
        border:1px solid #ccc;
        background-image:url("img/view.ico");
        background-repeat:no-repeat;
        background-position:center center;
    }

    </style>

     <script type="text/javascript" charset="utf-8">
         $(document).ready(function () {
             $('.btn_edit').click(function () {
                 var $td = $(this).closest('tr').children('td'),
            $name = $td.eq(0).text();


                 // Save it!
                 document.location = 'to-rentupdate.aspx?id=' + $name;



             });
         });
</script>
 <script type="text/javascript" charset="utf-8">
     $(document).ready(function () {
         $('.btn_del').click(function () {
             var $td = $(this).closest('tr').children('td'),
            $name = $td.eq(0).text();


             // Save it!
             document.location = 'delete-rent.aspx?id=' + $name;



         });
     });
</script>
 <script type="text/javascript" charset="utf-8">
     $(document).ready(function () {
         $('.btn_view').click(function () {
             var $td = $(this).closest('tr').children('td'),
            $name = $td.eq(0).text();


             // Save it!
             document.location = 'view_for_rent.aspx?id=' + $name;



         });
     });
</script>

    <script type="text/javascript" src="plugins/forms/uniform/jquery.uniform.min.js"></script>
        
    <!-- Fix plugins -->
  
    <script type="text/javascript" src="js/datatable.js"></script><!-- Init plugins only for page -->
 <%--<script>
     $('#dtable').dataTable({
         "bServerSide": true,
         "fnServerData": getRows,
         "bDestroy": true
     });

     </script>--%>